package org.nepu.sc.unit;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.lboot.jpa.entity.BaseEntity;
import org.nepu.sc.converter.DataVOConverter;
import org.nepu.sc.domain.DataVO;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "safe_unit")
@ApiModel("评价单元")
public class SafeUnit extends BaseEntity implements Serializable {
    @ApiModelProperty(value = "任务ID")
    @Column(name = "task_id")
    String taskId;

    @ApiModelProperty(value = "父级评价ID")
    @Column(name = "parent")
    String parentId;

    // b1 b1a b1a1 直到 DataVO 级别
    @ApiModelProperty(value = "评价ID")
    @Column(name = "rate_id")
    String rateId;

    // 联合作业安全管理文件...
    @ApiModelProperty(value = "评价名")
    @Column(name = "rate_name")
    String rateName;

    @ApiModelProperty(value = "评价参数")
    @Convert(converter = DataVOConverter.class)
    @Column(name = "rate_params",columnDefinition = "TEXT")
    DataVO rateParams;
}
